class Person {
  //声明成员属性
  name!: string;
  age: number;

  //默认调用这个构造函数
  constructor(name: string, age: number) {
    // this.name = name;
    this.age = age;
  }
}
const p1 = new Person("why", 12);
const p2 = new Person("kobe", 16);

console.log(p1.name, p2.age);

export {};
